package com.sunyard.domee.commons.exception;

import com.sunyard.domee.commons.constants.ErrorCode;
import lombok.Data;

/**
 * @program domee
 * @description
 * @author raoinyx@163.com
 * @create 2020-07-18 00:23
 */
@Data
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;
    private ErrorCodeService errorCode;
    private String detailMsg;

    public BusinessException(ErrorCode memberIsError){
    }

    public BusinessException(ErrorCodeService error, String detailMsg) {
        super(detailMsg);
        this.errorCode = error;
        this.detailMsg = detailMsg;
    }

    public BusinessException(ErrorCodeService error) {
        super(error.getMessage());
        this.errorCode = error;
    }

    public BusinessException(ErrorCodeService error, Throwable e) {
        super(error.getMessage(), e);
        this.errorCode = error;
    }
}
